import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue2";
import path from "path";

export default defineConfig({
  plugins: [vue()],

  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  server: {
    // 处理跨域
    proxy: {
      "/api": {
        // target: "http://127.0.0.1:8000",
        target: "http://www.rick1001b.com",
        // target: "http://8.153.205.173",

        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, "/api"),
      },
    },
  },
  build: {
    outDir: "dist",
  },
});
